<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>X支付 - 后台管理 - 商户资产列表</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="__ADMIN__/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="__ADMIN__/style/admin.css" media="all">
</head>

<body>

    <div class="layui-fluid">
        <div class="layui-card">
            <div class="layui-form layui-card-header layuiadmin-card-header-auto">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">商户ID</label>
                        <div class="layui-input-block">
                            <input type="text" name="uid" placeholder="请输入商户ID" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <button class="layui-btn layuiadmin-btn-useradmin" lay-submit
                            lay-filter="app-balance-list-search">
                            <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                        </button>
                    </div>
                </div>
            </div>

            <div class="layui-card-body">
                <table id="app-balance-list" lay-filter="app-balance-list"></table>
                <script type="text/html" id="buttonTpl">
                {{#  if(d.status == '1'){ }}
                <button class="layui-btn layui-btn-xs">正常</button>
                {{#  } else { }}
                <button class="layui-btn layui-btn-danger layui-btn-xs">禁止操作</button>
                {{#  } }}
            </script>
            <script type="text/html" id="table-balance-list">
                <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="changeEnableMoney"><i class="layui-icon layui-icon-rmb"></i>可用余额变动</a>
                <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="changeDisableMoney"><i class="layui-icon layui-icon-rmb"></i>待结算余额变动</a>
                <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="details"><i class="layui-icon layui-icon-edit"></i>查看明细</a>
            </script>
            </div>
        </div>
    </div>

    <script src="__ADMIN__/layui/layui.js"></script>
    <script>
        layui.config({
            version: new Date(),
            base: '__ADMIN__/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'balance', 'laydate', 'form', 'table'], function () {
            var $ = layui.$
                , form = layui.form
                , laydate = layui.laydate
                , table = layui.table;

            //同时绑定多个日期
            lay('.app-laydate-item').each(function () {
                laydate.render({
                    elem: this
                    , value: new Date()
                    , trigger: 'click'
                });
            });

            //监听搜索
            form.on('submit(app-balance-list-search)', function (data) {
                var field = data.field;

                //执行重载
                table.reload('app-balance-list', {
                    loading:false,
                    url: "getList",
                    where: field,
                    page: {
                        curr: 1 //重新从第 1 页开始
                    }
                });
            });

            $('[lay-filter="app-balance-list-search"]').click();
        });

    </script>
</body>

</html>